package com.probox.platform.api.factory;

import com.probox.common.core.domain.R;
import com.probox.platform.api.RemotePlatformService;
import com.probox.platform.api.domain.*;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 平台服务降级处理
 */
@Component
public class RemotePlatformFallbackFactory implements FallbackFactory<RemotePlatformService> {

    private static final Logger log = LoggerFactory.getLogger(RemotePlatformFallbackFactory.class);


    @Override
    public RemotePlatformService create(Throwable throwable) {
        return new RemotePlatformService() {

            /**
             * 获取平台信息
             *
             * @param platformUid
             * @return
             */
            @Override
            public R<PlatformInfoVo> getPlatform(Long platformUid) {
                return R.fail("获取店铺的信息出错：" + throwable.getMessage());
            }




        };
    }
}
